home *** CD-ROM | disk | FTP | other *** search
/ Venus 7000 / darktronics.iso / Software / Service Packs / WinXPSP1.exe / appwiz.cp_ / appwiz.cpl / HTML / ACCEL.HTC next >
Encoding:
Text File  |  2002-08-29  |  1.5 KB  |  54 lines

  1. <PUBLIC:HTC URN="shellctls"><ATTACH event="oncontentready" handler=_OnContentReady /><SCRIPT language="javascript">
  2. var _bLoading = true; 
  3. var _idFor = null;
  4. var _szText = null;
  5. var _ichAccel = 0;
  6. var _chAccel;
  7. var c_szAccelStyle = "style = 'text-decoration:underline; accelerator:true'";
  8. element.attachEvent("onerror", _OnError);
  9. _GetPropertyDefaults();
  10. function get_forCtl() { return _idFor; }
  11. function put_forCtl(id) 
  12. if (_bLoading)
  13. return;
  14. _idFor = id;
  15. }
  16. function _OnContentReady()
  17. {
  18. _bLoading = false;
  19. _ScanForAccelerator();
  20. _CreateHTML();
  21. }
  22. function _GetPropertyDefaults()
  23. {
  24. if (element.forElem)
  25. _idFor = element.forElem;
  26. }
  27. function _ScanForAccelerator()
  28. {
  29. var sz = element.innerText;
  30. _ichAccel = sz.indexOf('&');
  31. _szText = sz.substring(0, _ichAccel);
  32. if (_ichAccel < sz.length - 1)
  33. _szText = _szText + sz.substring(_ichAccel+1, sz.length);
  34. if (0 <= _ichAccel)
  35. _chAccel = sz.charAt(_ichAccel+1);
  36. }
  37. function _CreateHTML()
  38. {
  39. element.innerHTML =
  40. '<LABEL id=idLblAccel_' + uniqueID + ' for=' + _idFor + ' accesskey="' + _chAccel + '">' +
  41. _szText.substring(0, _ichAccel) +
  42. '<SPAN ' + c_szAccelStyle + '>' +
  43. _szText.substring(_ichAccel, _ichAccel+1) +
  44. '</SPAN>' +
  45. _szText.substring(_ichAccel+1, _szText.length) +
  46. '</LABEL>';
  47. }
  48. function _OnError(szMsg, szUrl, iLine)
  49. {
  50. alert("An unexpected error occurred.\n\n" + szMsg + "\n" + szUrl + "\nLine: " + iLine);
  51. return true; 
  52. }
  53. </SCRIPT><PROPERTY name="forElem" get=get_forCtl put=put_forCtl /></PUBLIC:HTC>